package com.cqhilink.api.common.utils.mail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * 发邮件的身份验证器
 *
 * @author 王镇
 * @create 2017-08-03 17:16
 */
public class MyAuthenticator  extends Authenticator {
    String userName=null;
    String password=null;

    public MyAuthenticator() {

    }

    public MyAuthenticator(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }

    protected PasswordAuthentication getPasswordAuthentication(){
        return new PasswordAuthentication(userName, password);
    }
}
